//
// Created by Arikes on 9/25/21.
//

#ifndef DESIGNERMODE_CONTEXT_H
#define DESIGNERMODE_CONTEXT_H

#include "Strategy.h"
namespace StrategyMode
{
    class Context
    {
    public:
        Context() = default;
        ~Context() = default;

        Strategy* getStrategy() {
            return _strategy;
        }
        void setStrategy(Strategy* strategy) {
            _strategy = strategy;
        }
        void strategyMethod() {
            _strategy->strategyMethod();
        }
    private:
        Strategy* _strategy = nullptr;
    };
}

#endif //DESIGNERMODE_CONTEXT_H


//StrategyMode::Context* context = new StrategyMode::Context;
//context->setStrategy(new StrategyMode::ConcreteStrategyA());
//context->strategyMethod();
//
//context->setStrategy(new StrategyMode::ConcreteStrategyB());
//context->strategyMethod();